cache:
  paths:
    - vendor/
stages:
  - test
  - publish
._test: &test_template
  stage: test
  only:
    - master
  script:
    - bundle exec rake --trace
._build: &alpine_requirements
  image: ruby:2.5-alpine
  before_script:
    - apk add --update build-base libffi-dev libcurl
    - gem install ffi
    - bundle install -j4 --path vendor
test_alpine:
  <<: *alpine_requirements
  <<: *test_template
test_defacto:
  image: ruby:2.5
  before_script:
    - bundle install -j4
  <<: *test_template
pages: # https://docs.gitlab.com/ce/user/project/pages/introduction.html
  <<: *alpine_requirements
  stage: publish
  script:
    - bundle exec rake doc:publish
  artifacts:
    paths:
      - public
  only:
    - master
